package com.mxl.mapper;


import com.mxl.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface BookMapper {
    @Select("SELECT * from book where id = #{id}")
    Book getBookById(int id);

    List<Book> getBookByType(@Param("type") String type,@Param("name") String name);

    List<Book> getChooseBook(@Param("type") String type,@Param("name") String name);

    void addBook(Book book);
}
